﻿using System;
using System.Linq;
using System.Text;

namespace AgileLogistics.Model
{
    ///<summary>
    ///
    ///</summary>
    public partial class Users
    {
           public Users(){


           }
           /// <summary>
           /// Desc:
           /// Default:
           /// Nullable:False
           /// </summary>     
           /// 
           [SqlSugar.SugarColumn(IsPrimaryKey =true)]
           public string  Id {get;set;}
           public int DepId {get;set;}
           public int RoleId {get;set;}

           /// <summary>
           /// Desc:
           /// Default:
           /// Nullable:False
           /// </summary>           
           public string Name {get;set;}

           /// <summary>
           /// Desc:
           /// Default:
           /// Nullable:False
           /// </summary>           
           public string Password {get;set;}

           /// <summary>
           /// Desc:
           /// Default:
           /// Nullable:True
           /// </summary>           
           public string Sex {get;set;}

           /// <summary>
           /// Desc:
           /// Default:
           /// Nullable:True
           /// </summary>           
           public string Post {get;set;}

           /// <summary>
           /// Desc:
           /// Default:
           /// Nullable:True
           /// </summary>           
           public string Phone {get;set;}

           /// <summary>
           /// Desc:
           /// Default:
           /// Nullable:True
           /// </summary>           
           public string IDCard {get;set;}

           /// <summary>
           /// Desc:
           /// Default:
           /// Nullable:True
           /// </summary>           
           public string Address {get;set;}

           /// <summary>
           /// Desc:
           /// Default:
           /// Nullable:True
           /// </summary>           
           public string Remark {get;set;}


        [SqlSugar.SugarColumn(IsIgnore = true)]

        public Depment Depment
        {
            get
            {
                DBContext dB = new DBContext();
                return dB.DB.Queryable<Depment>().Where(d => d.Id == this.DepId).First();
            }
        }

        [SqlSugar.SugarColumn(IsIgnore = true)]
        public Roles Role
        {
            get
            {
                DBContext dB = new DBContext();
                return dB.DB.Queryable<Roles>().Where(r => r.Id == this.RoleId).First();
            }
        }
    }
}
